home *** CD-ROM | disk | FTP | other *** search
/ PC-SIG: World of Education / PC-SiG's World of Education.iso / run / 0707 / curvefit.doc < prev    next >
Text File  |  1992-05-08  |  40KB  |  771 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. DOCUMENTATION FOR THE CURVEFIT PROGRAM (Documentation File Updated 05/09/92)
  8. ───────────────────────────────────────────────────────────────────────────
  9.  
  10. Introduction:
  11. ╔═══════════╦══════════════════════════════════════════════════════╦══════════╗
  12. ║ CURVEFIT  ║ Version 2.25a  MAY  09, 1992       by  Thomas S. Cox ║SHAREWARE ║
  13. ╠═══════════╩══════════════════════════════════════════════════════╩══════════╣
  14. ║ PURPOSE     This program performs a least squares curve fit on X, Y data.   ║
  15. ║             Curves for 25 equations are fitted.  Equation coefficients,     ║
  16. ║             Correlation Coefficient, and Best Fit are computed.  For any    ║
  17. ║             of the 25 equations, predictions for Y can be calculated.       ║
  18. ║                                                                             ║
  19. ║ REFERENCE   CURVE FITTING FOR PROGRAMMABLE CALCULATORS by William M. Kolb   ║
  20. ║             Publisher: IMTEC  P. O. Box 1402  Bowie MD  20716 (Out of Print)║
  21. ║                                                                             ║
  22. ║ WARNING     A LINEARIZING  technique is applied to various equations so that║
  23. ║ and         the resulting equations are of the general form: Y=A+B*X        ║
  24. ║ DISCLAIMER  This means that sum of squares of errors in Y are not minimized,║
  25. ║             but the sum of squares of the linearized variable are minimized.║
  26. ║                                                                             ║
  27. ║             The Linear, Parabolic, Cubic and Hyperbolic equations are linear║
  28. ║             in the parameters so this reservation does not apply to those   ║
  29. ║             curves. Reservation applies to equations with LN, EXP or POWERS.║
  30. ║                                                                             ║
  31. ║ SHAREWARE   If you use and like this program a donation of $10 is requested.║
  32. ╠═════════════════════════════════════════════════════════════════════════════╣
  33. ║ PROGRAM     Compiled using POWER BASIC Version 2.10a by Spectra Publishing  ║
  34. ║             ASCII source file is also supplied.                             ║
  35. ║                                                                             ║
  36. ║ ACCURACY:  Extended precision routines are used to insure                   ║
  37. ║            accuracy.  No exponentiation routines are used.                  ║
  38. ║                                                                             ║
  39. ║ COMMENTS:  IBM line graphics characters are used in this program.           ║
  40. ║                                                                             ║
  41. ║                 This  implementation supports positive, negative and        ║
  42. ║                 zero values for X and Y.  999 points are permitted.         ║
  43. ║                                                                             ║
  44. ║                 This program uses the LOCATE command extensively for        ║
  45. ║                 improved ease of data entry and data changes.  Printer      ║
  46. ║                 may be used with this program, but is not required.         ║
  47. ║                                                                             ║
  48. ║                 For equation 9, R squared is not computed.                  ║
  49. ║                 No formula was given in the reference source.               ║
  50. ║                                                                             ║
  51. ║                 This program will automatically DELETE any blank or         ║
  52. ║                 null lines that are created at the top of a                 ║
  53. ║                 LOTUS 1-2-3 .PRN file.                                      ║
  54. ║                                                                             ║
  55. ╚═════════════════════════════════════════════════════════════════════════════╝
  56.  
  57.  
  58.  
  59.  
  60. Documentation File for CURVEFIT Version 2.25a   05/09/92  Page 1
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  Main Program Menu:
  74. ╔═══════════╦══════════════════════════════════════════════════════╦══════════╗
  75. ║ CURVEFIT  ║  Version 2.25a   MAY  09, 1992    by  Thomas S. Cox  ║SHAREWARE ║
  76. ╠═══════════╩══════════╤═══════════════════════════════════════════╩══════════╣
  77. ║ POWER BASIC VERS 2.1A│          M  A  S  T  E  R     M  E  N  U             ║
  78. ╠═══════════╦══════════╪══════════════════════════════════════════════════════╣
  79. ║  SELECT   ║ CHOICES  │ BRIEF DESCRIPTION OF CHOICES                         ║
  80. ╠═══════════╬══════════╪══════════════════════════════════════════════════════╣
  81. ║      F1[ ]║ KEYBD DAT│ New Data (X and Y values) Entered from Keyboard      ║
  82. ║      F2[ ]║ DISK DATA│ Load From Disk a Previously Stored Data File         ║
  83. ║      F3[ ]║  ADD DATA│ Add Additional X,Y Data to Data Already in Memory    ║
  84. ║      F4[ ]║  DEL DATA│ or CHANGE Values of X and Y Currently in Memory      ║
  85. ║      F5[ ]║ LIST DATA│ X and Y Values Currently in Memory                   ║
  86. ║      F6[ ]║ CALC COEF│ Equation Coefficients (A, B, C, and R^2)             ║
  87. ║      F7[ ]║ RESIDUALS│ For Input Values of X, Y and Eq# (1-25) Show Residual║
  88. ║      F8[ ]║ VIEW EQTS│ LIST of EQUATIONS Fitted Using this Program          ║
  89. ║      F9[ ]║ VIEW COEF│ Equation Coefficients (A, B, C, R^2)                 ║
  90. ║     F10[ ]║ PREDICT Y│ For any Equation, Enter Range of X to see Predicted Y║
  91. ║ SHFT F1[ ]║ SAVE DATA│ X and Y Data Points to a DISK FILE                   ║
  92. ║ SHFT F2[ ]║ SUM OF SQ│ Display or Print SUMS and SUMS of SQUARES for REGRESS║
  93. ║ SHFT F3[ ]║  BEST FIT│ Sorted by R² (Coefficients MUST have been calculated)║
  94. ║ SHFT F4[ ]║ COLR/MONO│ Select COLOR or MONOCHROME (Default is COLOR + HERC) ║
  95. ╠═══════════╩══════════╧══════════════════════════════════════════════════════╣
  96. ║ Use UP or DOWN Keys to Select, Press ENTER; or FUNCTION KEY.  <ESC> to EXIT ║
  97. ╚═════════════════════════════════════════════════════════════════════════════╝
  98.  1.  KEYBD DATA       Clears out any previously entered data to prepare
  99.                       for new data entry from Keyboard.
  100.  2.  DISK DATA        Load previously stored data from a disk file.  Over-
  101.                       writes any existing data.  May use a comma or space
  102.                       separated file, LOTUS or SuperCalc PRN files, or files
  103.                       created by CURVEFIT.
  104.  3.  ADD DATA         Add data to previously entered data.  Once data are
  105.                       added, coefficients should be recalculated to reflect
  106.                       the effect of the additions.  Removes <DEL> data before
  107.                       showing any data.
  108.  4.  DEL DATA         Delete or Change any data point.  Coefficients should
  109.                       be recalculated to reflect the effect of any changes.
  110.                       Will show <DEL> data if <LIST DATA> or <ADD DATA> not
  111.               already run.
  112.  5.  LIST DATA        Will show on screen or printer the current values of
  113.                       X and Y.  Removes <DEL> data before showing any data.
  114.  6.  CALC COEF        Calculates the equation coefficients and value of R².
  115.  7.  RESIDUALS        For the entered X and Y values and Equation # (1-25).
  116.                       Calculates predicted Y and Residual.  
  117.  8.  VIEW EQTS        Show on screen list of equations fitted using CURVEFIT.
  118.  9.  VIEW COEF        Show coefficients (A, B, C) and R².
  119. 10.  PREDICT Y        Input a range of X values and see calculated Y values.
  120. 11.  SAVE DATA        Stores current X and Y data points to a disk file.
  121. 12.  SUM OF SQ        Displays or Prints Sums and Sums of Squares
  122. 13.  BEST FIT         Shows equations sorted by value of R² for R²>0.10
  123. 14.  COLR/MONO        Choice of Color or Monochrome.  Default is Color.
  124.                       If a color monitor is used, text is white on a blue.
  125.                       
  126. Documentation File for CURVEFIT Version 2.25a 05/09/92  Page 2      
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. ╔═══════════════════════════════════════════════════════════════════════════╗
  140. ║                      EQUATIONS FITTED USING THIS PROGRAM                  ║
  141. ╠════════════════════════════════════╦══════════════════════════════════════╣
  142. ║  1. Y=A+B*X       STR. LINE        ║   2. Y=B*X           LINE THRU ORG.  ║
  143. ║  3. Y=1/(A+B*X)   REC. STR LINE    ║   4. Y=A+B*X+C/X     LIN AND RECIP.  ║
  144. ║  5. Y=A+B/X       HYPERBOLA        ║   6. Y=X/(A*X+B)     RECIP HYPERBOLA ║
  145. ║  7. Y=A+B/X+C/X*X 2ND ORD HYP      ║   8. Y=A+B*X+C*X*X   PARABOLA        ║
  146. ║  9. Y=A*X+B*X*X   PAR AT ORIGIN    ║  10. Y=A*X^B         POWER           ║
  147. ║ 11. Y=A*B^X       MOD. POWER       ║  12. Y=A*B^(1/X)     ROOT            ║
  148. ║ 13. Y=A*X^(B*X)   SUPER GEOMET.    ║  14. Y=A*X^(B/X)     MOD GEOMETRIC   ║
  149. ║ 15. Y=A*e^(B*X)   EXPONENTIAL      ║  16. Y=A*e^(B/X)     MOD EXPONENTIAL ║
  150. ║ 17. Y=A+B*ln(X)   LOGARITHMIC      ║  18. Y=1/(A+B*ln(X))   RECIP LOG     ║
  151. ║ 19. Y=A*B^X*X^C   HOERL FUNCTION   ║  20. Y=A*B^(1/X)*X^C   MOD HOERL     ║
  152. ║ 21. Y=A*e^(((X-B)^2/)/C) NORMAL    ║  22. Y=A*e^((ln(X)-B)^2/C) LOG NORMAL║
  153. ║ 23. Y=A*X^B*(1-X)^C   BETA         ║  24. Y=A*(X/B)^C*e^(X/B)   GAMMA     ║
  154. ║ 25. Y=1/(A*(X+B)^2+C) CAUCHY       ║                                      ║
  155. ╠════════════════════════════════════╩══════════════════════════════════════╣
  156. ║      NOTES:  A.  Values of X and Y may be positive, negative, or zero     ║
  157. ║              B.  Up to 999 values of X and Y can be used.                 ║
  158. ╠═══════════════════════════════════════════════════════════════════════════╣
  159. ║      Press <RETURN> to continue program execution                         ║
  160. ╚═══════════════════════════════════════════════════════════════════════════╝
  161. Note: Equations 19 and 24 and Equations 12 and 16 are essentially identical.
  162.  
  163.         BRIEF EXPLANATION OF EQUATIONS:
  164.  
  165.        1.   Straight Line                         Full Accuracy Least Squares
  166.        2.   Straight Line through the Origin      Full Accuracy Least Squares
  167.        3.   Reciprocal of Straight Line           Full Accuracy Least Squares
  168.        4.   Combined Linear and Reciprocal        Full Accuracy Least Squares
  169.        5.   Hyperbola                             Full Accuracy Least Squares
  170.        6.   Reciprocal of a Hyperbola             Full Accuracy Least Squares
  171.        7.   Second Order Hyperbola                Full Accuracy Least Squares
  172.        8.   Parabola                              Full Accuracy Least Squares
  173.        9.   Parabola Through Origin               Full Accuracy Least Squares
  174.       10.  Power                                  LINEARIZED
  175.       11.  Modified Power                         LINEARIZED
  176.       12.  Root (Modification of Modified Power)  LINEARIZED
  177.       13.  Super Geometric                        LINEARIZED
  178.       14.  Modified Geometric                     LINEARIZED
  179.       15.  Exponential                            LINEARIZED
  180.       16.  Modified Exponential (Similar to Root) LINEARIZED
  181.       17.  Logarithmic                            LINEARIZED
  182.       18.  Reciprocal of Logarithmic              LINEARIZED
  183.       19.  Hoerl's Equation                       LINEARIZED
  184.       20.  Modified Hoerl's Equation              LINEARIZED
  185.       21.  Normal Distribution (Gaussian)         LINEARIZED
  186.       22.  Log Normal                             LINEARIZED
  187.       23.  Beta Distribution (0<X<1)              LINEARIZED
  188.       24.  Gamma Distribution                     LINEARIZED
  189.       25.  Cauchy Distribution                    LINEARIZED
  190.  
  191.  
  192. Documentation File for CURVEFIT Version 2.25a 05/09/92  Page 3      
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.     LISTING OF SUMS AND SUMS OF SQUARES (DEFINITION)
  206.  
  207.     The array R() is used to hold these values.  The contents are:
  208.  
  209.                     R(16)=R(16)+X(I)             Note: R(1) through R(15)
  210.                     R(17)=R(17)+X(I)*X(I)              are not used by this
  211.                     R(18)=R(18)+Y(I)                   program.
  212.                     R(19)=R(19)+Y(I)*Y(I)
  213.                     R(20)=R(20)+X(I)*Y(I)
  214.                     R(21)=I
  215.                     R(22)=R(22)+(1/X(I))
  216.                     R(23)=R(23)+(1/(X(I)*X(I)))
  217.                     R(24)=R(24)+(1/(Y(I)))
  218.                     R(25)=R(25)+(1/(Y(I)*Y(I)))
  219.                     R(26)=R(26)+(1/(Y(I)*X(I)))
  220.                     R(27)=I
  221.                     R(28)=R(28)+LOG(X(I))
  222.                     R(29)=R(29)+(LOG(X(I)))^2
  223.                     R(30)=R(30)+(LOG(Y(I)))
  224.                     R(31)=R(31)+(LOG(Y(I)))^2
  225.                     R(32)=R(32)+(LOG(X(I)))*(LOG(Y(I)))
  226.                     R(33)=I
  227.                     R(34)=R(34)+(X(I)/Y(I))
  228.                     R(35)=R(35)+(Y(I)/X(I))
  229.                     R(36)=R(36)+(X(I)^2)*Y(I)
  230.                     R(37)=R(37)+(X(I)^2)/Y(I)
  231.                     R(38)=R(38)+(Y(I)/X(I)^2)
  232.                     R(39)=R(39)+X(I)*Y(I)^2
  233.                     R(40)=R(40)+X(I)^3
  234.                     R(41)=R(41)+1/(X(I)^3)
  235.                     R(42)=R(42)+Y(I)^3
  236.                     R(43)=R(43)+X(I)^4
  237.                     R(44)=R(44)+1/(X(I)^4)
  238.                     R(45)=R(45)+LOG(X(I))/X(I)
  239.                     R(46)=R(46)+X(I)*LOG(Y(I))
  240.                     R(47)=R(47)+LOG(Y(I))/X(I)
  241.                     R(48)=R(48)+X(I)*LOG(X(I))
  242.                     R(49)=R(49)+(X(I)*LOG(X(I)))^2
  243.                     R(50)=R(50)+X(I)*LOG(X(I))*LOG(Y(I))
  244.                     R(51)=R(51)+Y(I)*LOG(X(I))
  245.                     R(52)=R(52)+LOG(X(I))/Y(I)
  246.                     R(53)=R(53)+((LOG(X(I))/X(I)))^2
  247.                     R(54)=R(54)+X(I)^2*LOG(Y(I))
  248.                     R(55)=R(55)+(LOG(X(I)))^3
  249.                     R(56)=R(56)+(LOG(X(I)))^4
  250.                     R(57)=R(57)+(LOG(X(I))^2)*LOG(Y(I))
  251.                     R(58)=R(58)+(LOG(Y(I))*LOG(X(I)))/X(I)
  252.                     R(59)=R(59)+LOG(1-X(I))
  253.                     R(60)=R(60)+(LOG(1-X(I)))^2
  254.                     R(61)=R(61)+LOG(X(I))*LOG(1-X(I))
  255.                     R(62)=R(62)+LOG(Y(I))*LOG(1-X(I))
  256.                     R(63)=R(63)+(LOG(X(I)))/X(I)
  257.  
  258. Documentation File for CURVEFIT Version 2.25a 05/09/92  Page 4      
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  EXAMPLE DATA ENTRY SCREEN
  272. ╔═══════════╦═══════════════════════════════════════════════════════╦═════════╗
  273. ║ CURVEFIT  ║  Version 2.25a   MAY  09, 1992      by Thomas S. Cox  ║SHAREWARE║
  274. ╠═══════════╩═══════════════════════════════════════════════════════╩═════════╣
  275. ║ DATA ENTRY SCREEN|  Press <ESC> at X or Y entry to Terminate Data Entry     ║
  276. ╟───┬──────────┬──────────┬───┬──────────┬──────────┬───┬──────────┬──────────╢
  277. ║PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  ║
  278. ╟───┼──────────┼──────────┼───┼──────────┼──────────┼───┼──────────┼──────────╢
  279. ║░░░│░░░░░░░░░░│░░░░░░░░░░│   │          │          │   │          │          ║
  280. ║   │          │          │   │          │          │   │          │          ║
  281. ║   │          │          │   │          │          │   │          │          ║
  282. ║   │          │          │   │          │          │   │          │          ║
  283. ║   │          │          │   │          │          │   │          │          ║
  284. ║   │          │          │   │          │          │   │          │          ║
  285. ║   │          │          │   │          │          │   │          │          ║
  286. ║   │          │          │   │          │          │   │          │          ║
  287. ║   │          │          │   │          │          │   │          │          ║
  288. ║   │          │          │   │          │          │   │          │          ║
  289. ║   │          │          │   │          │          │   │          │          ║
  290. ║   │          │          │   │          │          │   │          │          ║
  291. ║   │          │          │   │          │          │   │          │          ║
  292. ║   │          │          │   │          │          │   │          │          ║
  293. ╠═══╧════════╦═╧═════════╦╧═══╧══╦═══════╧═════╦════╧══╦╧══════════╧══════════╣
  294. ║ ENTER DATA ║PT #     1 ║X VALUE║ ░░░░░░░░░░░ ║Y VALUE║                      ║
  295. ╚════════════╩═══════════╩═══════╩═════════════╩═══════╩══════════════════════╝
  296.  
  297.  EXAMPLE DATA ADDITION SCREEN
  298. ╔═══════════╦═══════════════════════════════════════════════════════╦═════════╗
  299. ║ CURVEFIT  ║  Version 2.25a   MAY  09, 1992      by Thomas S. Cox  ║SHAREWARE║
  300. ╠═══════════╩═══════════════════════════════════════════════════════╩═════════╣
  301. ║ DATA ADDITION| Press <ESC> for X or Y to Terminate Data Entry               ║
  302. ╟───┬──────────┬──────────┬───┬──────────┬──────────┬───┬──────────┬──────────╢
  303. ║PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  ║
  304. ╟───┼──────────┼──────────┼───┼──────────┼──────────┼───┼──────────┼──────────╢
  305. ║  1│   20.0000│    1.2000│   │          │          │   │          │          ║
  306. ║  2│   40.0000│    2.0000│   │          │          │   │          │          ║
  307. ║  3│   60.0000│    2.8000│   │          │          │   │          │          ║
  308. ║  4│   70.0000│    3.2000│   │          │          │   │          │          ║
  309. ║  5│   80.0000│    3.6000│   │          │          │   │          │          ║
  310. ║░░░│░░░░░░░░░░│░░░░░░░░░░│   │          │          │   │          │          ║
  311. ║   │          │          │   │          │          │   │          │          ║
  312. ║   │          │          │   │          │          │   │          │          ║
  313. ║   │          │          │   │          │          │   │          │          ║
  314. ║   │          │          │   │          │          │   │          │          ║
  315. ║   │          │          │   │          │          │   │          │          ║
  316. ║   │          │          │   │          │          │   │          │          ║
  317. ║   │          │          │   │          │          │   │          │          ║
  318. ║   │          │          │   │          │          │   │          │          ║
  319. ╠═══╧════════╦═╧═════════╦╧═══╧══╦═══════╧═════╦════╧══╦╧══════════╧══════════╣
  320. ║ ENTER DATA ║PT #      6║X VALUE║ ░░░░░░░░░░░ ║Y VALUE║                      ║
  321. ╚════════════╩═══════════╩═══════╩═════════════╩═══════╩══════════════════════╝
  322.  
  323.  
  324. Documentation File for CURVEFIT Version 2.25a 05/09/92  Page 5      
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  EXAMPLE DATA CORRECTION SCREEN
  338. ╔═══════════╦═══════════════════════════════════════════════════════╦═════════╗
  339. ║ CURVEFIT  ║  Version 2.25a   MAY  09, 1992      by Thomas S. Cox  ║SHAREWARE║
  340. ╠═══════════╩═══════════════════════════════════════════════════════╩═════════╣
  341. ║ DATA CORRECTION| <ESC> for Data # to Exit, 'D' or 'd' for X or Y to Delete  ║
  342. ╟───┬──────────┬──────────┬───┬──────────┬──────────┬───┬──────────┬──────────╢
  343. ║PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  ║
  344. ╟───┼──────────┼──────────┼───┼──────────┼──────────┼───┼──────────┼──────────╢
  345. ║  1│       20 │       1.2│   │          │          │   │          │          ║
  346. ║  2│       40 │         2│   │          │          │   │          │          ║
  347. ║  3│       60 │       2.8│   │          │          │   │          │          ║
  348. ║  4│       70 │       3.2│   │          │          │   │          │          ║
  349. ║  5│       80 │       3.6│   │          │          │   │          │          ║
  350. ║░░░│░░░░░░░░░░│░░░░░░░░░░│   │          │          │   │          │          ║
  351. ║   │          │          │   │          │          │   │          │          ║
  352. ║   │          │          │   │          │          │   │          │          ║
  353. ║   │          │          │   │          │          │   │          │          ║
  354. ║   │          │          │   │          │          │   │          │          ║
  355. ║   │          │          │   │          │          │   │          │          ║
  356. ║   │          │          │   │          │          │   │          │          ║
  357. ║   │          │          │   │          │          │   │          │          ║
  358. ║   │          │          │   │          │          │   │          │          ║
  359. ╠═══╧════════╦═╧═════════╦╧═══╧══╦═══════╧═════╦════╧══╦╧══════════╧══════════╣
  360. ║ ENTER DATA ║PT # ░░░░░ ║X VALUE║             ║Y VALUE║                      ║
  361. ╚════════════╩═══════════╩═══════╩═════════════╩═══════╩══════════════════════╝
  362.  
  363.  EXAMPLE DATA LISTING SCREEN
  364. ╔═══════════╤══════════════════════════════════════════════════════╤══════════╗
  365. ║ CURVEFIT  │ DATA LIST OF X AND Y VALUES  NOW IN MEMORY           │VERS 2.25a║
  366. ╟───┬───────┴──┬──────────┬───┬──────────┬──────────┬───┬──────────┼──────────╢
  367. ║PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  │PT#│ X VALUE  │ Y VALUE  ║
  368. ╟───┼──────────┼──────────┼───┼──────────┼──────────┼───┼──────────┼──────────╢
  369. ║  1│   20.0000│    1.2000│   │          │          │   │          │          ║
  370. ║  2│   40.0000│    2.0000│   │          │          │   │          │          ║
  371. ║  3│   60.0000│    2.8000│   │          │          │   │          │          ║
  372. ║  4│   70.0000│    3.2000│   │          │          │   │          │          ║
  373. ║  5│   80.0000│    3.6000│   │          │          │   │          │          ║
  374. ║   │          │          │   │          │          │   │          │          ║
  375. ║   │          │          │   │          │          │   │          │          ║
  376. ║   │          │          │   │          │          │   │          │          ║
  377. ║   │          │          │   │          │          │   │          │          ║
  378. ║   │          │          │   │          │          │   │          │          ║
  379. ║   │          │          │   │          │          │   │          │          ║
  380. ║   │          │          │   │          │          │   │          │          ║
  381. ║   │          │          │   │          │          │   │          │          ║
  382. ║   │          │          │   │          │          │   │          │          ║
  383. ║   │          │          │   │          │          │   │          │          ║
  384. ║   │          │          │   │          │          │   │          │          ║
  385. ║   │          │          │   │          │          │   │          │          ║
  386. ║   │          │          │   │          │          │   │          │          ║
  387. ╚═══╧══════════╧══════════╧═══╧══════════╧══════════╧═══╧══════════╧══════════╝
  388.  
  389.  
  390. Documentation File for CURVEFIT Version 2.25a 05/09/92  Page 6      
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  EXAMPLE CALCULATE AND REVIEW COEFFICIENTS SCREEN
  404. ╔═══════════╦════════════════════════════════════╦════════════════════════════╗
  405. ║ CURVEFIT  ║ LISTING OF CALCULATED COEFFICIENTS ║ BEST FIT EQUATION IS #  1  ║
  406. ╠════╤══════╩═════╤════════════╤════════════╤════╩═╤══════╤═══════════════════╣
  407. ║EQ #│ 'A' COEF.  │ 'B' COEF.  │ 'C' COEF.  │ R²   │R² COR│ EQUATION OF CURVE ║
  408. ╟────┼────────────┼────────────┼────────────┼──────┼──────┼───────────────────╢
  409. ║  1 │      0.4000│      0.0400│      0.0000│1.0000│1.0000│Y=A+B*X            ║
  410. ║  2 │      0.0000│      0.0464│      0.0000│0.9704│0.9704│Y=B*X              ║
  411. ║  3 │      0.9442│     -0.0090│      0.0000│0.9180│0.8906│Y=1/(A+B*X)        ║
  412. ║  4 │      0.0000│      0.0000│      0.0000│0.0000│0.0000│Y=A+B*X+C/X        ║
  413. ║  5 │      3.9429│    -58.3720│      0.0000│0.8784│0.8378│Y=A+B/X            ║
  414. ║  6 │      0.1090│     14.6548│      0.0000│0.9955│0.9940│Y=X/(A*X+B)        ║
  415. ║  7 │      5.8651│   -220.1911│   2539.5892│0.9939│0.9879│Y=A+B/X+C/X*X      ║
  416. ║  8 │      0.0000│      0.0000│      0.0000│0.0000│0.0000│Y=A+B*X+C*X*X      ║
  417. ║  9 │      0.0574│     -0.0002│      0.0000│0.0000│0.0000│Y=A*X+B*X*X        ║
  418. ║ 10 │      0.1107│      0.7910│      0.0000│0.9986│0.9982│Y=A*X^B            ║
  419. ║ 11 │      0.8939│      1.0184│      0.0000│0.9780│0.9707│Y=A*B^X            ║
  420. ║ 12 │      4.6336│ 6.86307E-13│      0.0000│0.9569│0.9425│Y=A*B^(1/X)        ║
  421. ║ 13 │      1.0505│      0.0037│      0.0000│0.9658│0.9544│Y=A*X^(B*X)        ║
  422. ║ 14 │      6.2337│    -11.2767│      0.0000│0.9782│0.9710│Y=A*X^(B/X)        ║
  423. ║ 15 │      0.8939│      0.0182│      0.0000│0.9780│0.9707│Y=A*e^(B*X)        ║
  424. ║ 16 │      4.6336│    -28.0075│      0.0000│0.9569│0.9425│Y=A*e^(B/X)        ║
  425. ╟────┼────────────┼────────────┼────────────┼──────┼──────┼───────────────────╢
  426. ║BEST│      0.4000│      0.0400│      0.0000│1.0000│1.0000│Y=A+B*X            ║
  427. ╚════╧════════════╧════════════╧════════════╧══════╧══════╧═══════════════════╝
  428.  
  429.  EXAMPLE DATA PREDICTION SCREEN  VERSION 2.25a 
  430. ╔═══════════╦═════════════╤═════╤══════╤════════════════════════════╦═════════╗
  431. ║ CURVEFIT  ║ PREDICTIONS │ EQ# │ 1    │Y=A+B*X                     ║VER 2.25a║
  432. ╠═══════╤═══╩═════════════╪═════╧╤═════╧═══════════╤══════╤═════════╩═════════╣
  433. ║ START │ 10              │ STOP │ 100             │ STEP │ 2                 ║
  434. ╟───────┴────┬────────────┼──────┴─────┬───────────┴┬─────┴──────┬────────────╢
  435. ║X-DATA ENTRY│PREDICTED Y │X-DATA ENTRY│PREDICTED Y │X-DATA ENTRY│PREDICTED Y ║
  436. ╟────────────┼────────────┼────────────┼────────────┼────────────┼────────────╢
  437. ║     10.0000│      0.8000│     38.0000│      1.9200│     66.0000│      3.0400║
  438. ║     12.0000│      0.8800│     40.0000│      2.0000│     68.0000│      3.1200║
  439. ║     14.0000│      0.9600│     42.0000│      2.0800│     70.0000│      3.2000║
  440. ║     16.0000│      1.0400│     44.0000│      2.1600│     72.0000│      3.2800║
  441. ║     18.0000│      1.1200│     46.0000│      2.2400│     74.0000│      3.3600║
  442. ║     20.0000│      1.2000│     48.0000│      2.3200│     76.0000│      3.4400║
  443. ║     22.0000│      1.2800│     50.0000│      2.4000│     78.0000│      3.5200║
  444. ║     24.0000│      1.3600│     52.0000│      2.4800│     80.0000│      3.6000║
  445. ║     26.0000│      1.4400│     54.0000│      2.5600│     82.0000│      3.6800║
  446. ║     28.0000│      1.5200│     56.0000│      2.6400│     84.0000│      3.7600║
  447. ║     30.0000│      1.6000│     58.0000│      2.7200│     86.0000│      3.8400║
  448. ║     32.0000│      1.6800│     60.0000│      2.8000│     88.0000│      3.9200║
  449. ║     34.0000│      1.7600│     62.0000│      2.8800│     90.0000│      4.0000║
  450. ║     36.0000│      1.8400│     64.0000│      2.9600│     92.0000│      4.0800║
  451. ╟────────────┴───┬────────┴───────┬────┴───────────┬┴────────────┴──┬─────────╢
  452. ║ Coefficients   │A=      0.4000  │B=      0.0400  │C=      0.0000  │R²=1.0000║
  453. ╚════════════════╧════════════════╧════════════════╧════════════════╧═════════╝
  454.  
  455.  
  456. Documentation File for CURVEFIT Version 2.25a 05/09/92  Page 7      
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  Example of BEST FIT Screen                   
  470. ╔═══════════╦═══════════════════════════════════════════════════╦═════════════╗
  471. ║ CURVEFIT  ║ SORTED LISTING OF EQUATIONS for CORRECTED R² >0.10║VERSION 2.25a║
  472. ╠════╤══════╩═════╤════════════╤════════════╤══════╤══════╤═════╩═════════════╣
  473. ║EQ #│ 'A' COEF.  │ 'B' COEF.  │ 'C' COEF.  │ R²   │R² COR│ EQUATION OF CURVE ║
  474. ╟────┼────────────┼────────────┼────────────┼──────┼──────┼───────────────────╢
  475. ║  1 │      0.4000│      0.0400│      0.0000│1.0000│1.0000│Y=A+B*X            ║
  476. ║ 20 │      0.0497│    487.5355│      0.9595│1.0000│1.0000│Y=A*B^(1/X)*X^C    ║
  477. ║ 22 │      0.2736│     -1.3288│     12.6516│1.0000│1.0000│Y=A*e^((lnX-B)^2/C)║
  478. ║ 24 │      5.8841│    273.3730│      0.6362│1.0000│0.9999│Y=A*(X/B)^C*e^(x/b)║
  479. ║ 19 │      0.1657│      1.0037│      0.6362│1.0000│0.9999│Y=A*B^X*X^C        ║
  480. ║ 21 │      3.9850│    106.1905│  -6217.7704│0.9994│0.9987│Y=A*e^(((X-B)^2)/C)║
  481. ║ 10 │      0.1107│      0.7910│      0.0000│0.9986│0.9982│Y=A*X^B            ║
  482. ║  6 │      0.1090│     14.6548│      0.0000│0.9955│0.9940│Y=X/(A*X+B)        ║
  483. ║ 25 │      0.0002│    -78.4589│      0.2895│0.9951│0.9902│Y=1/(A*(X+B)^2+C)  ║
  484. ║  7 │      5.8651│   -220.1911│   2539.5892│0.9939│0.9879│Y=A+B/X+C/X*X      ║
  485. ║ 18 │      2.0236│     -0.4038│      0.0000│0.9889│0.9852│Y=1/(A+B*lnX)      ║
  486. ║ 14 │      6.2337│    -11.2767│      0.0000│0.9782│0.9710│Y=A*X^(B/X)        ║
  487. ║ 15 │      0.8939│      0.0182│      0.0000│0.9780│0.9707│Y=A*e^(B*X)        ║
  488. ║ 11 │      0.8939│      1.0184│      0.0000│0.9780│0.9707│Y=A*B^X            ║
  489. ║  2 │      0.0000│      0.0464│      0.0000│0.9704│0.9704│Y=B*X              ║
  490. ║ 17 │     -4.0091│      1.6922│      0.0000│0.9660│0.9547│Y=A+B*lnX          ║
  491. ║ 13 │      1.0505│      0.0037│      0.0000│0.9658│0.9544│Y=A*X^(B*X)        ║
  492. ║ 16 │      4.6336│    -28.0075│      0.0000│0.9569│0.9425│Y=A*e^(B/X)        ║
  493. ╚════╧════════════╧════════════╧════════════╧══════╧══════╧═══════════════════╝
  494.  
  495. Example RESIDUAL Calculation Screen
  496. ╔═══════════╦═════════════╤═════╤══════╤════════════════════════════╤═════════╗
  497. ║ CURVEFIT  ║  RESIDUALS  │ EQ# │ 1 ▒▒▒│BEST Y=A+B*X                │VER 2.25a║
  498. ╠═══════════╩╤════════════╪═════╧══════╪═════════════╤═════════════╤╧═════════╣
  499. ║X-DATA ENTRY│Y-DATA ENTRY│CALCULATED Y│RESIDUAL VAL │CSUM ABS(RES)│  POINT # ║
  500. ╟────────────┼────────────┼────────────┼─────────────┼─────────────┼──────────╢
  501. ║     20.0000│      1.2000│      1.2000│ 1.11022E-15 │ 1.11022E-15 │        1 ║
  502. ║     40.0000│      2.0000│      2.0000│ 6.66134E-16 │ 1.77636E-15 │        2 ║
  503. ║     60.0000│      2.8000│      2.8000│      0.0000 │ 1.77636E-15 │        3 ║
  504. ║     70.0000│      3.2000│      3.2000│      0.0000 │ 1.77636E-15 │        4 ║
  505. ║     80.0000│      3.6000│      3.6000│      0.0000 │ 1.77636E-15 │        5 ║
  506. ║            │            │            │             │             │          ║
  507. ║            │            │            │             │             │          ║
  508. ║            │            │            │             │             │          ║
  509. ║            │            │            │             │             │          ║
  510. ║            │            │            │             │             │          ║
  511. ║            │            │            │             │             │          ║
  512. ║            │            │            │             │             │          ║
  513. ║            │            │            │             │             │          ║
  514. ║            │            │            │             │             │          ║
  515. ║            │            │            │             │             │          ║
  516. ║            │            │            │             │             │          ║
  517. ╟────────────┴───┬────────┴───────┬────┴───────────┬─┴─────────────┴┬─────────╢
  518. ║ Coefficients   │A=      0.4000  │B=      0.0400  │C=      0.0000  │R²=1.0000║
  519. ╚════════════════╧════════════════╧════════════════╧════════════════╧═════════╝
  520.  
  521.  
  522. Documentation File for CURVEFIT Version 2.25a 05/09/92  Page 8      
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  MISCELLANEOUS NOTES:
  536.  
  537.  
  538.   1.  LISTING DATA  Will show 54 data points per screen.  To view
  539.                     next 54 data points, press <ENTER>. <ESC> to Exit.
  540.  
  541.   2.  ADD DATA      When reading data into screen array, program
  542.                     will show all data in sets of 42 points per screen.
  543.                     Press <ENTER> to advance.  Prompt for PT# will be
  544.                     for one data point higher than currently existing
  545.                     number of data points.  Entering <ESC> for X or Y
  546.                     will terminate additions.
  547.  
  548.   3.  DELETE DATA   Screen will look similar to ADDITION screen.
  549.  
  550.                     IMPORTANT NOTE:  If 'S' is stored as a DATAPOINT,
  551.                                      that point will be last one
  552.                                      recognized, even if there is more
  553.                                      valid data.  Always exit from
  554.                                      this routine by entering <ESC> for any
  555.                                      data point number.                
  556.                                     
  557.  
  558.                     To change data, just enter point number and the new
  559.                     values for X and Y.
  560.  
  561.  
  562.   4.  DATA FILES    Program will read a file that has blank lines in it such
  563.       WITH BLANK    as might be created with a word-processing program.  
  564.       LINES         CURVEFIT will insert 'DEL' at the appropriate places and
  565.                     delete them at the time of listing data or calculating
  566.                     equation coefficients.  Data file will automatically be
  567.                     condensed to fill slots occupied by 'DEL'.                 
  568.      
  569.   5.  COMPILED VS   The program is now too large to use with Interpreter or
  570.       INTERPRETER   QBASIC.                                               
  571.                                                                               
  572.                                                                               
  573.                                                                           
  574.                                                                            
  575.                                         
  576.         
  577.   6.  MONITOR       Program is known to work satisfactorily with Hercules 
  578.                     compatible video cards, CGA cards, EGA cards, and VGA.
  579.                     MONOCHROME option from program is needed for some video
  580.                     cards.  With color monitors, color is high intensity white
  581.                     on blue.  
  582.   
  583.   7. COMPILER       Set all options except 8087 required.
  584.      OPTIONS                                                                 
  585.  
  586.  
  587.  
  588. Documentation File for CURVEFIT Version 2.25a 05/09/92  Page 9      
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.   8. OPTION         If the cursor keys are used to select options, it doesn't
  604.      SELECTION      matter whether or not the NUMBER-LOCK function is active
  605.      WITH CURSOR    since the program will also use 8 for the up arrow and 2  
  606.      KEYS           for the down arrow.                      
  607.   
  608.   9. MEANING OF     This occurs particularly for equation #2 as there was no
  609.      R^2 = ZERO     listing in the source material of a formula for this 
  610.                     value.  It is listed as zero to indicate that value was
  611.                     not calculated.
  612.  
  613.  10. MEANING OF     Some equations do not use C.  For those equations, C is
  614.      C = ZERO       listed as zero.  
  615.  
  616.  11. MEANING OF     For some data sets a number of the 25 equations used in
  617.      A, B, and C    this program are not usable.  In those cases, values
  618.      = ZERO         of A, B, and C are all set to zero.
  619.  
  620.  12. NUMBER OF      This program will handle up to 999 data points.
  621.      DATA POINTS
  622.  
  623.  13. DATA DISPLAY   ENTER DATA routine shows numbers with as much precision as
  624.                     possible.  Depending on magnitude of data, it will be
  625.                     displayed using one of the following formats
  626.                     #####.####, #######.##, ##########, or ##.##^^^^
  627.  
  628.                     LIST DATA and ADD DATA format is the same as for ENTER DATA 
  629.  
  630.                     DELETE or CORRECT routine shows the 10 left-most digits of
  631.                     number.  This is particularly useful for looking at small  
  632.                     numbers such as 0.002345, etc.  Note that using the DELETE
  633.                     or CORRECT routine to look at data does not necessarily 
  634.                     require one to delete or correct data.  Data are right
  635.                     justified within the 10 character limitation. This the only
  636.                     routine that does not automatically screen out <DEL> values
  637.  
  638.  
  639.  14. COEFFICIENT    This routine shows data either in the #######.#### or
  640.      LISTING        ##.#####^^^^ format depending on the number to be
  641.                     displayed.  In any case, up to 12 spaces will be allowed
  642.                     for this number.
  643.  
  644.  15. PREDICTION     Same format for data display as for COEFFICIENT LISTING. 
  645.  
  646.  16. DATA LISTING   No specific formatting routine is used so that all digits
  647.      TO PRINTER     are output.
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654. Documentation File for CURVEFIT Version 2.25a 05/09/92  Page 11     
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  17. TRACKING DATA  To aid in keeping track of where data will be entered a
  668.      ENTRY ON       block of ░░░░░░░░░░░░░░ will mark the place.
  669.      SCREEN
  670.                     The last X and Y values entered will still be displayed
  671.                     at the bottom of the screen.  For example, for entering
  672.                     data point #2, the value of Y1 will still be displayed as
  673.                     the Y entry.  Important Note: It is not possible to enter
  674.                     a series of data points that are the same value as the
  675.                     previous entry by pressing ENTER.  For the X-Data only, it
  676.                     it is possible to increment by the difference between the
  677.                     last two data entries for X by just pressing <ENTER>. All
  678.             Y-Data must be entered individually. 
  679.                         
  680.                     If data is entered using the DATA ENTER option and there
  681.                     are 'DEL' entries, these can be seen by calling up the
  682.                     DELETE routine.  LIST Data routine automatically packs 
  683.                     data and removes any DEL entries.                       
  684.                   
  685.  18. DATA FILE      Data is stored as two columns of X and Y data such that 
  686.      STORAGE        it may be read back into a program such as LOTUS, NWA
  687.      FORMAT         STATPAK, or the SHAREWARE program, CFIT.
  688.  
  689.  19. DATA FILE      Will read data in format used for Storage,
  690.      FORMAT         one column of data with alternating X and Y values,
  691.      READABLE       either of the above with leading blank lines or inter-
  692.                     spersed blank lines.
  693.  
  694.  20. BEST FIT       Based on the value of R^2 corrected to account for 
  695.                     degrees of freedom.  Sorted by decreasing value of R^2.
  696.  
  697.  21. REFERENCE      CURVE FITTING for PROGRAMMABLE CALCULATORS 
  698.                     by William M. Kolb
  699.                     PUBLISHED by IMTEC  P. O. Box 1402 Bowie, MD  20716
  700.                            
  701.                     This reference gives a full explanation of the equations
  702.                     used in this program and includes excellent graphs 
  703.                     showing the shapes of curves described by these equations.
  704.  
  705.                     A program specifically for the HP-41CV that fits 19 of the
  706.                     25 equations of CURVEFIT is listed along with barcode for
  707.                     easy entry of program into HP-41. (Book is out of print.)
  708.  
  709.  22. FILES          CURVE225.BAS    (ASCII Source File) 
  710.      SUPPLIED WITH  CURVE225.EXE    Executable file compiled using Spectra
  711.      CURVEFIT                       Publishing's POWER BASIC 2.10a
  712.                     CURVEFIT.DOC    This documentation file
  713.                     EX     *.*      Example Data Files                        
  714.                     DATA*   .PRN    More Example Data Files
  715.                     CF286225.EXE    Compiled to use '286 and higher processors
  716.                                     to best advantage.  Won't run on 8088/8086
  717.  
  718.  
  719.  
  720. Documentation File for CURVEFIT Version 2.25a 05/09/92  Page 12     
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733. SHAREWARE
  734. =========
  735. This program is SHAREWARE.  That means that if you use it, a small donation
  736. of $10.00 is requested by the author.
  737.  
  738. Program may be freely copied and distributed so long as there is no more than
  739. a $10.00 copying and handling charge.  Also, the program should be distributed
  740. with no alterations to the files.  The documentation files and example files
  741. must be included with program.
  742.  
  743. Feel free to place this program on any bulletin board system.  
  744.  
  745.  
  746.  
  747. The author welcomes any comments and suggestions.
  748.  
  749. The author is:
  750.  
  751.                              Thomas S. Cox
  752.                              102 Evergreen Street
  753.                              Easley, SC  29642
  754.  
  755. -------------------------------------------------------------------------------
  756. LATE NOTES:
  757.  
  758. There are two versions supplied: (1) CF286225 is optimized for 286 and higher 
  759. processors. (2) CURVE225 works with 8088/8086/80286/80386/ and 80486, but
  760. is not as fast on '286 and higher machines as CF286225.
  761.  
  762. The program LZE was used to compress the compiled .EXE files.  Cuts file
  763. size by about 60 percent.
  764.  
  765. The program is significantly less prone to crashing on troublesome data sets
  766. due to the increased precision allowed by the Extended Precision variables
  767. available in POWER BASIC.  Speed is significantly enhanced on machines
  768. not having a math co-processor. 
  769.  
  770.  
  771. Documentation File for CURVEFIT Version 2.25a 05/09/92  Page 13